<?php

namespace App\Kuafu\CouponExt\Channel;


class CouponExtReturn
{
    /**
     * 核销状态 true: 接口成功 false: 接口失败
     *
     * @var bool
     */
    public bool $status = false;

    /**
     * 错误码
     *
     * @var string
     */
    public string $code = '';

    /**
     * 错误信息
     *
     * @var string
     */
    public string $msg = '';

    /**
     * @var array  多种支付渠道合并后的，固定通用返回字段
     */
    public array $data = [];

    /**
     * 返回数据 oriData
     *
     * @var array
     */
    public array $oriData = [];

    /**
     * @return bool
     */
    public function isStatus(): bool
    {
        return $this->status;
    }

    /**
     * @param bool $status
     */
    public function setStatus(bool $status): void
    {
        $this->status = $status;
    }

    /**
     * @return string
     */
    public function getCode(): string
    {
        return $this->code;
    }

    /**
     * @param string $code
     */
    public function setCode(string $code): void
    {
        $this->code = $code;
    }

    /**
     * @return string
     */
    public function getMsg(): string
    {
        return $this->msg;
    }

    /**
     * @param string $msg
     */
    public function setMsg(string $msg): void
    {
        $this->msg = $msg;
    }

    /**
     * @return array
     */
    public function getData(): array
    {
        return $this->data;
    }

    /**
     * @param array $data
     */
    public function setData(array $data): void
    {
        $this->data = $data;
    }

    /**
     * @return array
     */
    public function getOriData(): array
    {
        return $this->oriData;
    }

    /**
     * @param array $oriData
     */
    public function setOriData(array $oriData): void
    {
        $this->oriData = $oriData;
    }

    /**
     * 返回数据格式的数据汇总
     *
     * @return array
     */
    public function getResultArray(): array
    {
        return [
            'status'  => $this->status,
            'code'    => $this->code,
            'msg'     => $this->msg,
            'data'    => $this->data,
            'oriData' => $this->oriData,
        ];
    }
}
